/* 页面容器 */
.ranking {
  min-height: 56.25rem;
  width: 41.875rem;
  margin: auto;
  background-color: #211c25;
  color: #fdcb77;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all 0.3s ease; /* 平滑过渡 */
}

/* 内容区域 */
.con {
  width: 85%;
  margin: 0 auto;
  transition: padding 0.3s ease; /* 平滑过渡 */
}

/* 排名前三容器 */
.Ranking_Three {
  display: flex;
  justify-content: space-between; /* 平均分配 */
  height: 13.125rem; /* 固定高度，防止跳动 */
  transition: all 0.3s ease; /* 平滑过渡 */
  margin-top: 36px;
}

/* 排名项 */
.rank-item {
  height: 12.5rem;
  width: 12.5rem; /* 固定宽度，确保统一 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-repeat: no-repeat;
  padding: 0.625rem;
  opacity: 0; /* 初始状态不可见 */
  transition: opacity 0.5s ease-in-out; /* 平滑显示 */
  margin: 0 1rem; /* 保证左右间距一致 */
  border-radius: 10px; /* 圆角边框 */
}

.rank-item.show {
  opacity: 1; /* 显示时变为完全可见 */
}

/* 第一名 */
.first-place {
  background-image: url("../../public/imgs/d2.png");
  background-position: 47% 115%;
  background-size: 12.5rem 13.125rem;
}

/* 第二名 */
.second-place {
  background-image: url("../../public/imgs/d1.png");
  background-position: 48% -70%;
  background-size: 11.875rem 12rem;
}

/* 第三名 */
.third-place {
  background-image: url("../../public/imgs/d3.png");
  background-position: 45% -60%;
  background-size: 11.875rem 11.8125rem;
}

/* 圆形头像 */
.rank-circle {
  background-image: linear-gradient(to bottom, #f7d695, #ceab7b);
  font-weight: bold;
  width: 2.8125rem;
  height: 2.8125rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p_Ranking {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0.3125rem 0;
}

.votes,
.name {
  color: #7b492b;
}

/* 响应式调整 */
@media screen and (max-width: 41.875rem) {
  .ranking {
    width: 100vw;
    min-height: 56.25rem;
  }

  .Ranking_Three {
    height: 13.125rem; /* 固定高度 */
  }

  .rank-item {
    height: 12.5rem;
    width: 12.5rem; /* 保证排名项宽度一致 */
    padding: 0.625rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    margin: 0 1rem; /* 保证左右间距一致 */
  }

  .rank-item.show {
    opacity: 1;
  }
}

.empty-ranking {
  font-size: 1.3rem;
  font-weight: bold;
  color: #fdcb77;
  background-color: #211c25;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
